Fix previous deleted and rediscovered MQTT devices are not placed in suggested area#170985
Fix previous deleted and rediscovered MQTT devices are not placed in suggested area#170985jbouwh wants to merge 2 commits into
Conversation
|
Hey there @emontnemery, @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
arturpragacz
left a comment
There was a problem hiding this comment.
When an MQTT device is then readded, a suggested area in the configuration should be respected, instead of restoring the area of the deleted entry.
I disagree. Why should MQTT behave differently here than every other integration?
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
MQTT is different because setting an area was long supported before deleted entities were stored. Als there are similar options like change the entity ID that have been implemented through MQTT. It is not that a device just can be updated. It must be deleted first, and also no other entries should have links to the same device entry. Systems like Zigbee2MQTT make use of this feature, and may be it was never meant to be this way, I think it makes sense to allow users to rediscover devices from their external eco system. @emontnemery what do you think? |
|
The I suggest we close this PR without merge. |
That property is used heavily on my roaming setup, not all IoT devices are fixed in place @emontnemery Now that it's broken, hopefully HA WebSocket can handle some polling abuse for many devices (hundred in my case) and have it updated on the official docs. |
Proposed change
When an MQTT device is removed, its deleted entry reference is kept.
When an MQTT device is then readded, a suggested area in the configuration should be respected, instead of restoring the area of the deleted entry.
Note that this fix will only work if the entity has a device configuration and the device was removed from the device registry before it was rediscovered.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: